package com.chenyaowei.happyhub.mapper.GoodsMapper;

import com.chenyaowei.happyhub.pojo.GoodsPojo.Good;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface GoodMapper {
    List<Good> selectGoodsByKeyword(@Param("keyword") String keyword);
    List<Good> selectGoodsByType(@Param("type") String type);
    List<Good> selectGoodsByAd();
    List<Good> selectGoodsBySlideAd();
    List<Good> selectGoodsByTypeAd(@Param("type") String type);
    List<Good> selectGoods();
    void updateSalesVolume(@Param("salesVolume") int salesVolume,@Param("salesPrice") float salesPrice,@Param("id") String id);
    Good selectGoodById(@Param("id") int id);
    List<Good> selectAdminGood();
    void updateGood(@Param("goodId") String goodId,@Param("goodHeader")String goodHeader,
                    @Param("goodMeta")String goodMeta,@Param("goodImage")String goodImage,
                    @Param("goodType")String goodType,@Param("goodDescription")String goodDescription,
                    @Param("isAd")String isAd,@Param("isTypeAd")String isTypeAd,@Param("isSlideAd")String isSlideAd);

    List<Good> searchGood(@Param("type") String type, @Param("keyword")String keyword, @Param("sort")String sort, @Param("status")String status);
    void deleteGood(@Param("id") String id);
}
